<?php
/*
=====================================================
 Generic Toolbox - by Carl Wells
-----------------------------------------------------
-----------------------------------------------------
 Copyright (c) 2009 Carl Wells
=====================================================
 THIS IS COPYRIGHTED SOFTWARE
 PLEASE READ THE LICENSE AGREEMENT
=====================================================
 File: system/addpromotion.php
-----------------------------------------------------
 Purpose: This file adds a supplied promotion to the database and creates all necessary items.
=====================================================
*/

// ----------------------------------------------
//  include CONFIG file
// ----------------------------------------------    
 	require 'config/config.php';
 	require_once "db/dbconnect.class.php";
 	
 	
	
// ----------------------------------------------
//  Instantiate MAIN CORE class
// ----------------------------------------------    
 	require 'core/main.class.php';
 	$MAIN = new main();  
 	
 	$db = new Connection();

	$sql = "";
 	$sql .= "INSERT INTO `posItems` VALUES (NULL, ";
 	
 		foreach($_POST as $key => $val) {
 		
 			$sql .= "'".$val."', ";
 		
 		}
 		
 	$sql = substr_replace($sql, "", -2);
 	
    $sql .= ")";
    
    mysql_query($sql) or die (mysql_error());
    
    header('location: index.php?act=pos');

?>